﻿package {
	import flash.display.*;
	import flash.events.*;
	
	public class EnableHandCursor extends MovieClip{
		
		public function EnableHandCursor() {
			chkButtonMode.addEventListener(Event.CHANGE, selectButtonMode);
			chkHandCursor.addEventListener(Event.CHANGE, selectHandCursor);
			chkMouseChildren.addEventListener(Event.CHANGE, selectMouseChildren);
			chkMouseEnabled.addEventListener(Event.CHANGE, selectMouseEnabled);
			chkTextSelectable.addEventListener(Event.CHANGE, selectTextSelectable);
		}
		
		private function selectButtonMode(event:Event):void {
			embeddedFont.buttonMode = chkButtonMode.selected;
			graphicOnly.buttonMode = chkButtonMode.selected;
			systemFont.buttonMode = chkButtonMode.selected;
		}
		
		private function selectHandCursor(event:Event):void {
			embeddedFont.useHandCursor = chkHandCursor.selected;
			graphicOnly.useHandCursor = chkHandCursor.selected;
			systemFont.useHandCursor = chkHandCursor.selected;
		}
		
		private function selectMouseChildren(event:Event):void {
			embeddedFont.mouseChildren = chkMouseChildren.selected;
			graphicOnly.mouseChildren = chkMouseChildren.selected;
			systemFont.mouseChildren = chkMouseChildren.selected;
		}
		
		private function selectMouseEnabled(event:Event):void {
			embeddedFont.tf.mouseEnabled = chkMouseEnabled.selected;
			//graphicOnly.mouseEnabled = chkMouseEnabled.selected;
			systemFont.tf.mouseEnabled = chkMouseEnabled.selected;
		}
		
		private function selectTextSelectable(event:Event):void {
			embeddedFont.tf.selectable = chkTextSelectable.selected;
			systemFont.tf.selectable = chkTextSelectable.selected;
		}
	}
}